﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Students
{
    public partial class WebFormInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void submit_Click(object sender, EventArgs e)
        {
            string html = string.Empty;
            html = this.firstName.Text + " " + this.lastName.Text + " is student in: <b>" + this.universities.Text + "</b> <br />";
            html += "with faculty number: <i>" + this.facNumber.Text + "</i>.<br />" + this.firstName.Text + "'s specialty is \"" +
                this.specialties.Text + "\" and visits";

            foreach (ListItem item in this.courses.Items)
            {
                if (item.Selected)
                {
                    html += " " + item.Text;
                }
            }
            html += " course(s).";
            this.literal.Text = html;
        }
    }
}